-
Notifications
You must be signed in to change notification settings - Fork 37.5k
Explore a controller based chat session item API #286642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot wasn't able to review any files in this pull request.
442306f to
e337681
Compare
For #276243 Explores moving the chat session item api to use a controller instead of a provider
e337681 to
3f197a6
Compare
bpasero
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no objections going with this API considering we have a similar one that seems finalised. But I am also not deep into providing sessions via API, so I would yield to @joshspicer and maybe @DonJayamanne and @osortega for final approval.
|
I'll try this out later today. |
…-controller Explore a controller based chat session item API
For #276243
Explores moving the chat session item api to use a controller instead of a provider. This uses managed objects and is based on the
TestControllerwe already have finalizedMain flow :
Extensions call
createChatSessionItemController('my.sessionId')to create the controller. The controller is a managed object with adisposemethodVS Code then calls
refreshHandleron the controller to build up the initial listDuring refresh, the extension updates the
ChatSessionItemCollectionmanaged object. This object is basically just a managed array. This lets the editor see changes that are made to the session listA few other points:
Chat session items would now also be managed objects. Extensions could set properties to update them in the UI
If an extension needs to update the list of chat session items independently of VS Code — for example if a new session is created through GitHub.com — it would simply update the
ChatSessionItemCollectionWe would have event handlers for when the editor archives or disposes of a chat session item
Still some open questions but seems promising. Also although the general API shape looks pretty different , the logic shouldn't be that different for extensions